package com.bestcem.xm.user.grpc.client.convert;

import com.bestcem.xm.bi.grpc.v1.services.Dashboard;
import com.bestcem.xm.bi.grpc.v1.services.Share;
import com.bestcem.xm.user.grpc.client.dto.BiShareDTO;
import com.bestcem.xm.user.grpc.client.dto.DashboardDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.NullValueCheckStrategy;

/**
 * bi相关服务转换类
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/20 12:44
 */
@Mapper(componentModel = "spring", nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface UserBaseBiGrpcConvert {

    @Mapping(target = "status", source = "statusValue")
    @Mapping(target = "requestPwdFlag", source = "requestPwdFlagValue")
    @Mapping(target = "dataFilterFlag", source = "dataFilterFlagValue")
    @Mapping(target = "emailInfoFlag", source = "emailInfoFlagValue")
    @Mapping(target = "shareType", source = "shareTypeValue")
    @Mapping(target = "dataFilterIdList", source = "dataFilterIdListList")
    BiShareDTO responseToBiShareDTO(Share share);

    @Mapping(target = "status", source = "statusValue")
    @Mapping(target = "listOrder", source = "listorder")
    @Mapping(target = "copyDemo", source = "isCopyDemo")
    DashboardDTO responseToDashboardDTO(Dashboard dashboard);
}
